export const setStorage  = function(key, value) {
  if(typeof value === 'object') {
    value = JSON.stringify(value)
  }

  localStorage.setItem(key, value)
}

export const getStorage  = function(key) {
  let value = localStorage.getItem(key)

  try {
    return JSON.parse(value)
  } catch(err) {
    return value
  }

}

export const removeStorage = function(key) {
  localStorage.removeItem(key)
}
